home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / MENU-ITM.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  66 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   MENU-ITM.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. $INCLUDE "DAS-NB01.INC"
  22. $INCLUDE "DAS-NB02.INC"
  23. $INCLUDE "DAS-NBT1.INC"
  24. $INCLUDE "DAS-NBT3.INC"
  25.  
  26. COLOR 7, 0, 0
  27. CLS
  28.  
  29. ? "┌──────────────────────────────────────────────────────────────────────────
  30. ? "│ fMenuItem?( Item$, NewItem$, OnOff?, NormAttr?, LtrAttr?, OffAttr? )
  31. ? "├──────────────────────────────────────────────────────────────────────────
  32. ? "│ Item$    is the incoming, unconverted menu item
  33. ? "│ NewItem$ is the converted menu item
  34. ? "│ OnOff?   if 0 then the item is deemed to be OFF else it is ACTIVE
  35. ? "│ Nattr?   normal item color attribute
  36. ? "│ Lattr?   hot-letter color attribute
  37. ? "│ Oattr?   off item color attribute
  38. ? "├──────────────────────────────────────────────────────────────────────────
  39. ? "│ This function is used by DDmenu and TmenuHOT when the hotkey style is 2.
  40. ? "│ It prepares the item string for printing with Tprint, extracts the letter
  41. ? "│ to be used as the hot-key and uses UCASEchar to convert it's value. This
  42. ? "│ is the value returned by the function. NewItem$ holds the newly created
  43. ? "│ string. The letter to be used as the hot-key should be preceded by an
  44. ? "│ underline CHR$(95). This character is removed in NewItem$
  45. ? "└──────────────────────────────────────────────────────────────────────────
  46.  
  47. DIM M$(2)
  48. M$(0) = "_Hello _Howard"     ' this doesn't work when item is OFF
  49. M$(1) = "Hello World"         ' this doesn't work well as no letter
  50. M$(2) = "Hello _ralff"        ' this is perfect!
  51. Nattr? =  80                  ' normal attr = black/magenta
  52. Lattr? =  94                  ' letter attr = YELLOW/magenta
  53. Oattr? =  93                  ' off attr    = MAGENTA/magenta
  54. Row?   =  18
  55.  
  56. FOR M? = 0 TO 2
  57.   FOR OnOff? = 0 TO 1
  58.     HotKey? = fTmenuItem?( M$(M?), I$, OnOff?, Nattr?, Lattr?, Oattr? )
  59.     LOCATE Row?, 1
  60.     IF OnOff? = 0 THEN PRINT "  ITEM OFF  "; ELSE PRINT "  ITEM ON   ";
  61.     PRINT M$(M?); TAB( 30 ); USING$( "ASCII HOT KEY ###", HotKey? )
  62.     Tprint Row?, 50, I$, Nattr?
  63.     INCR Row?, 1
  64.   NEXT
  65. NEXT
  66.